package net.wanho.day03;

import net.wanho.dao.CourseDaoI;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

public class CourseTest1 {
    static String config = "mybatisConfig.xml";
    static SqlSession ss = null;

    static {
        InputStream in = null;
        try {
            in = Resources.getResourceAsStream(config);
        } catch (IOException e) {
            e.printStackTrace();
        }
        SqlSessionFactory ssf = new SqlSessionFactoryBuilder().build(in);
        ss = ssf.openSession();
    }

    public static void main(String[] args) {

    }

    public static void selectCourseTeacher(){
        CourseDaoI cd=ss.getMapper(CourseDaoI.class);

    }
}
